package com.jiangruan.javaproject;

import com.alibaba.fastjson.JSONObject;
import com.jiangruan.javaproject.bean.HotVideoCommon;
import com.jiangruan.javaproject.net.HttpUtils;

/**
 * @author:liuzuoqiang
 * @email:2639571477@qq.com
 * @desc:
 * @datetime: 2021/12/24 21:11
 */

public class Dome {
    public static void main(String []args){
        System.out.println("hello world");

        String url = Constants.TRIP_URL
                + "?key=" + Constants.TRIP_KEY
                +"&type=hot_video"
                +"&size=20";
        String result = HttpUtils.get(url);
        System.out.println(result);

        //json解析
        HotVideoCommon videoCommon =JSONObject.parseObject(result, HotVideoCommon.class);
        System.out.println(videoCommon.reason);
        System.out.println(videoCommon.error_code);
        System.out.println(videoCommon.result.size());
    }


}
